/**
 *    Copyright (C) 2008, 2009  Victor Smirnov <aist11@gmail.com>
 *
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License along
 *    with this program; if not, write to the Free Software Foundation, Inc.,
 *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *    See LICENSE.exceptions in the root folder of this project for possible
 *    exceptions
 *
 */

#ifndef _CUBEFS_API_REFLECTION_FACTORY_HPP
#define	_CUBEFS_API_REFLECTION_FACTORY_HPP

#include <cubefs/api/macro.hpp>
#include <cubefs/api/reflection/id.hpp>
#include <cubefs/api/reflection/type.hpp>
#include <cubefs/api/reflection/value.hpp>
#include <cubefs/api/reflection/number.hpp>
#include <cubefs/api/reflection/list.hpp>
#include <cubefs/api/reflection/type_system.hpp>

#include <cubefs/api/tools/version.hpp>

namespace cubefs    {
namespace api       {

struct CUBEFS_API CoreFactory: public Typed {
	virtual ListOfTyped* CreateListOfTyped(Int size = -1)	= 0;
	virtual ListOfTypes* CreateListOfTypes(Int size = -1)	= 0;
	virtual StaticListOfTyped* CreateStaticListOfTyped()	= 0;
	virtual ListOfStrings* CreateListOfStrings(Int size = -1)= 0;
	virtual ListOfBigInt* CreateListOfBigInt(Int size = -1)	= 0;

//	virtual ByteNumber* CreateByteNumber(Byte value)		= 0;
//	virtual UByteNumber* CreateUByteNumber(UByte value)		= 0;
//	virtual ShortNumber* CreateShortNumber(Short value)		= 0;
//	virtual UShortNumber* CreateUShortNumber(UShort value)	= 0;
//	virtual IntNumber* CreateIntNumber(Int value)			= 0;
//	virtual UIntNumber* CreateUIntNumber(UInt value)		= 0;
//	virtual BigIntNumber* CreateBigIntNumber(BigInt value)	= 0;
//	virtual FloatNumber* CreateFloatNumber(float value)		= 0;
//	virtual DoubleNumber* CreateDoubleNumber(double value)	= 0;
//	virtual TypedIDValue* CreateIDValue(const IDValue &id)	= 0;
//	virtual StringValue* CreateStringValue(StringRef str)	= 0;
//	virtual BooleanValue* CreateBooleanValue(bool value)	= 0;
//	virtual VersionValue* CreateVersionValue(StringRef ver)	= 0;

	virtual ByteNumber* 	Create(Byte value)				= 0;
	virtual UByteNumber* 	Create(UByte value)				= 0;
	virtual ShortNumber* 	Create(Short value)				= 0;
	virtual UShortNumber* 	Create(UShort value)			= 0;
	virtual IntNumber* 		Create(Int value)				= 0;
	virtual UIntNumber* 	Create(UInt value)				= 0;
	virtual BigIntNumber* 	Create(BigInt value)			= 0;
	virtual FloatNumber* 	Create(float value)				= 0;
	virtual DoubleNumber* 	Create(double value)			= 0;
	virtual TypedIDValue* 	Create(const IDValue &id)		= 0;
	virtual TypedIDValue* 	CreateIDValue(StringRef id)		= 0;
	virtual StringValue* 	Create(StringRef str)			= 0;
	virtual BooleanValue* 	Create(bool value)				= 0;
	virtual VersionValue* 	Create(const Version& ver)		= 0;
	virtual VersionValue* 	CreateVersion(StringRef ver)	= 0;

	virtual TypeSystem*		GetCoreTypeSystem()				= 0;

    static Type* MyType();
};

CUBEFS_DECLARE_TYPENAME(CoreFactory, "cubefs::api::CoreFactory");

}
}

extern "C" CUBEFS_API cubefs::api::CoreFactory* GetCoreFactory();

#endif
